package com.d0327;

import java.io.*;

public class Test {
    public static void main(String[] args) throws Exception{
        File f= new File("src/com/d0327/java.txt");
        FileWriter fw=new FileWriter(f);
        BufferedWriter bw=new BufferedWriter(fw);
        bw.write(
                "Offline installation requires you to download an executable " +
                "file available at the manual Java download page," +
                " which includes all the files needed for the complete installation at the user's discretion." +
                "There is no need to remain connected to the Internet during the installation.");
        bw.close();
        fw.close();
        FileReader fr=new FileReader(f);
        BufferedReader br=new BufferedReader(fr);
        String str=br.readLine();
        br.close();
        br.close();
        String[] arr=str.split(" ");
        String s="";
        int a=0;
        int b=0;
        int c=0;
        for (int i=0;i<arr.length;i++){
            s=arr[i];
            if (s.equals("class")){
                a++;
            }
            if (s.equals("interface")){
                b++;
            }
            if (s.equals("break")){
                c++;
            }
        }
        System.out.println("class:"+a+"\t"+"interface:"+b+"\t"+"break"+c);

    }
}
